﻿<Window x:Class="LoD.Tools.TilesetMaker.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:LoD.Tools.TilesetMaker"
        Title="Land of Dreams - Tileset Maker V0.2" Height="320" Width="550" Icon="TilesetMaker.ico">
    
    <Window.Resources>
        <local:EnumBooleanConverter x:Key="enumBooleanConverter" />
    </Window.Resources>
    
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="120" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="40" />
            <RowDefinition Height="40" />
            <RowDefinition Height="40" />
            <RowDefinition Height="40" />
            <RowDefinition Height="40" />
            <RowDefinition Height="40" />
            <RowDefinition Height="40" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Label Content="Type of Tilemap" FontWeight="Bold" Height="28" HorizontalAlignment="Left" Margin="0,7,0,0" VerticalAlignment="Top" />
        <StackPanel Orientation="Horizontal" Grid.Column="1" Grid.ColumnSpan="2">
            <RadioButton IsChecked="{Binding Path=Type, Converter={StaticResource enumBooleanConverter}, ConverterParameter=Mobile}" Content="Mobiles" Grid.Column="1" Height="16" HorizontalAlignment="Left" Margin="12,12,0,0" GroupName="tilemapType" VerticalAlignment="Top" />
            <RadioButton IsChecked="{Binding Path=Type, Converter={StaticResource enumBooleanConverter}, ConverterParameter=Items}" Content="Items" Height="16" HorizontalAlignment="Left" Margin="12,12,0,0" GroupName="tilemapType" VerticalAlignment="Top" Grid.Column="2" />
            <RadioButton IsChecked="{Binding Path=Type, Converter={StaticResource enumBooleanConverter}, ConverterParameter=Gumps}" Content="Gumps" Height="16" HorizontalAlignment="Left" Margin="12,12,0,0" GroupName="tilemapType" VerticalAlignment="Top" Grid.Column="2" />
        </StackPanel>
        <StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2">
            <Label Content="Tile size:" FontWeight="Bold" Height="28" HorizontalAlignment="Left" Margin="0,7,0,0" VerticalAlignment="Top" />
            <TextBox Width="40" Margin="12, 10" Text="{Binding Path=TileSizeX, UpdateSourceTrigger=PropertyChanged}" />
            <Label Content="x" Height="28" HorizontalAlignment="Left" Margin="0,7,0,0" VerticalAlignment="Top" />
            <TextBox Width="40" Margin="12, 10" Text="{Binding Path=TileSizeY, UpdateSourceTrigger=PropertyChanged}" />
            <Label Content="Pixels" Height="28" HorizontalAlignment="Left" Margin="0,7,0,0" VerticalAlignment="Top" />
        </StackPanel>
        <StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="2">
            <Label Content="Tileset size:" FontWeight="Bold" Height="28" HorizontalAlignment="Left" Margin="12,7,0,0" VerticalAlignment="Top" />
            <Label Content="{Binding Path=TilesetSize, Mode=OneWay}" Height="28" HorizontalAlignment="Left" Margin="12,7,0,0" VerticalAlignment="Top" />
        </StackPanel>
        
        <StackPanel Orientation="Horizontal" Grid.Row="2" VerticalAlignment="Center" Grid.ColumnSpan="2">
            <Label Content="Frames:" FontWeight="Bold" />
            <Slider Margin="12,7" Width="200" Value="{Binding Path=FramesAmount}" Maximum="12" Minimum="1" />
            <Label Content="{Binding Path=FramesAmount}" Margin="12,7" />
        </StackPanel>
        
        <StackPanel Orientation="Horizontal" Grid.Row="2" VerticalAlignment="Center" Grid.Column="2">
            <Label Content="Separator:" FontWeight="Bold" />
            <TextBox Text="{Binding Path=Separator, UpdateSourceTrigger=PropertyChanged}" MaxLength="1" Width="30" TextAlignment="Center" IsEnabled="{Binding Path=Type, Converter={StaticResource enumBooleanConverter}, ConverterParameter=Mobile}" />
        </StackPanel>
        
        <Label Content="Character name" Grid.Row="3" Grid.Column="0" FontWeight="Bold" Height="28" HorizontalAlignment="Left" Margin="0,7,0,0" VerticalAlignment="Top" />
        <TextBox Grid.Column="1" Grid.Row="3" Text="{Binding Path=Name, UpdateSourceTrigger=PropertyChanged}" Margin="12,0" VerticalAlignment="Center" IsEnabled="{Binding Path=Type, Converter={StaticResource enumBooleanConverter}, ConverterParameter=Mobile}" />

        <Label Content="Animation name" Grid.Row="4" Grid.Column="0" FontWeight="Bold" Height="28" HorizontalAlignment="Left" Margin="0,7,0,0" VerticalAlignment="Top" />
        <ComboBox ItemsSource="{Binding Path=Animations, Mode=OneTime}" IsSynchronizedWithCurrentItem="True" DisplayMemberPath="Key" Grid.Column="1" Grid.Row="4" Height="28" Margin="12,0" IsEnabled="{Binding Path=Type, Converter={StaticResource enumBooleanConverter}, ConverterParameter=Mobile}" />
        <TextBox Grid.Column="2" Grid.Row="4" Text="{Binding Path=Animations/Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="12,0" VerticalAlignment="Center" IsEnabled="{Binding Path=Type, Converter={StaticResource enumBooleanConverter}, ConverterParameter=Mobile}" />
        
        <Label Content="Direction name" Grid.Row="5" Grid.Column="0" FontWeight="Bold" Height="28" HorizontalAlignment="Left" Margin="0,7,0,0" VerticalAlignment="Top" />
        <ComboBox ItemsSource="{Binding Path=Directions, Mode=OneTime}" DisplayMemberPath="Key" IsSynchronizedWithCurrentItem="True" Grid.Column="1" Grid.Row="5" Height="28" Margin="12,0" IsEnabled="{Binding Path=Type, Converter={StaticResource enumBooleanConverter}, ConverterParameter=Mobile}" />
        <TextBox Grid.Column="2" Grid.Row="5" Text="{Binding Path=Directions/Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="12,0" VerticalAlignment="Center" IsEnabled="{Binding Path=Type, Converter={StaticResource enumBooleanConverter}, ConverterParameter=Mobile}" />

        <StackPanel Orientation="Horizontal" Grid.Row="6" Grid.ColumnSpan="2" VerticalAlignment="Center">
            <Label Content="Example:" FontFamily="Courier New" />
            <Label Content="{Binding Path=ExampleFilename}" FontFamily="Courier New" />
        </StackPanel>
        <Button Grid.Column="2" Grid.Row="6" Margin="12,7" Content="Create Tileset" Click="CreateTilesetButtonClick" />
    </Grid>
</Window>
